import request from '@/utils/request'

// 课程分类管理
export function queryCourseCate(query) {
  return request({
    url: '/mba/category/list',
    method: 'get',
    params: query
  })
}
export function addCourseCate (query) {
  return request({
    url: '/mba/category',
    method: 'post',
    data: query
  })
}
export function updateCourseCate (query) {
  return request({
    url: '/mba/category',
    method: 'put',
    data: query
  })
}
export function delCourseCate (id) {
  return request({
    url: `/mba/category/${id}`,
    method: 'delete'
  })
}

// 课程管理--增删改查
export function queryCourseList(query) {
  return request({
    url: '/mba/course/list',
    method: 'get',
    params: query
  })
}
export function queryCourseListById(id) {
  return request({
    url: `/mba/course/${id}`,
    method: 'get'
  })
}
export function addCourse (query) {
  return request({
    url: '/mba/course',
    method: 'post',
    data: query
  })
}
export function updateCourse (query) {
  return request({
    url: '/mba/course',
    method: 'put',
    data: query
  })
}
export function delCourse (id) {
  return request({
    url: `/mba/course/${id}`,
    method: 'delete'
  })
}

// 视频管理--增删改查
export function queryVideoList(query) {
  return request({
    url: '/mba/video/list',
    method: 'get',
    params: query
  })
}
export function addVideo (query) {
  return request({
    url: '/mba/video',
    method: 'post',
    data: query
  })
}
export function updateVideo (query) {
  return request({
    url: '/mba/video',
    method: 'put',
    data: query
  })
}
export function delVideo (id) {
  return request({
    url: `/mba/video/${id}`,
    method: 'delete'
  })
}


// 题库管理----增删改查
export function queryTopicList(query) {
  return request({
    url: '/exam/topic/list',
    method: 'get',
    params: query
  })
}
export function addTopic (query) {
  return request({
    url: '/exam/topic',
    method: 'post',
    data: query
  })
}
export function updateTopic (query) {
  return request({
    url: '/exam/topic',
    method: 'put',
    data: query
  })
}
export function delTopic (id) {
  return request({
    url: `/exam/topic/${id}`,
    method: 'delete'
  })
}


// 获取阿里oss密钥
export function getAliOSSConfig() {
  return request({
    url: `/mba/course/gettoken`,
    method: 'get'
  })
}
